<?  // widgetu renderēšana, nezkāpēc gribējās ielikt iekš viewa ?>
<?  $renderedWidgets=array() ?>
<?  foreach ($widgetPositionsGrouped as $placeholderName => $widgetPositions):  ?>
<?      foreach ($widgetPositions as $widgetPosition): ?>
<?          $widget=$widgetPosition->getWidget() ?>
<?
            $renderedWidgets[$widgetPosition->getPlaceholderName()][]=
                get_component(
                    "widgets",
                    "widget",
                    array(
                        /** @todo $vars maybe? **/
                        "widget"            =>  $widget,
                        "widgetPosition"    =>  $widgetPosition,
                        "currentSection"    =>  $currentSection,
                        "currentTag"        =>  $currentTag,
                        "entries"           =>  $entries,
                        "settings"          =>  $settings,
                        "templateSettings"  =>  $templateSettings,
                        "application"       =>  $application,
                    )
                )
?>
<?      endforeach ?>
<?  endforeach ?>

<?
    include_partial(
        "entries/templatePart",
        array(
            /** @todo $vars+widgets maybe? **/
            "currentSection"    =>  $currentSection,
            "currentTag"        =>  $currentTag,
            "entries"           =>  $entries,
            "widgets"           =>  $renderedWidgets,
            "settings"          =>  $settings,
            "templateSettings"  =>  $templateSettings,
            "application"       =>  $application,
        )
    )
?>
